/*
 * @Author: dvlproad
 * @Date: 2023-10-12 18:19:47
 * @LastEditors: dvlproad
 * @LastEditTime: 2023-10-30 19:27:17
 * @Description: 
 */
import 'package:flutter/material.dart';

import 'ts_shared_normalview_container.dart';
import 'ts_shared_normalview_util.dart';

class TSViewAddToDiffPage extends StatefulWidget {
  @override
  _TSViewAddToDiffPageState createState() => _TSViewAddToDiffPageState();
}

class _TSViewAddToDiffPageState extends State<TSViewAddToDiffPage> {
  int currentPageIndex = 0;

  @override
  void initState() {
    super.initState();
    currentPageIndex = 0;
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('第${currentPageIndex + 1}页'),
      ),
      body: Container(
        color: const Color.fromRGBO(245, 245, 245, 1.0),
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            ElevatedButton(
              onPressed: goNext,
              child: const Text('进入下一页'),
            ),
            TSSharedNormalViewUtil.sharedNormalViewContainer,
          ],
        ),
      ),
    );
  }

  void goNext() {
    setState(() {
      currentPageIndex++;
    });
    Navigator.push(
      context,
      MaterialPageRoute(
        builder: (_) => TSViewAddToDiffPage(),
      ),
    );
  }
}
